﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Common/Site.Master" AutoEventWireup="true"
    CodeBehind="SetNewPassword.aspx.cs" Inherits="FortuneHeaven.Web.Pages.UserCenter.SetNewPassword" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link type="text/css" rel="stylesheet" href="../../Content/CSS/password.css" />
 <script type="text/javascript">
 function GetLevel(s) {
         if (s.length < 4) {
             return 0;
         }
         var ls = 0;
         if (s.match(/[a-z]/ig)) {
             ls++;
         }
         if (s.match(/[0-9]/ig)) {
             ls++;
         }
         if (s.match(/(.[^a-z0-9])/ig)) {
             ls++;
         }
         if (s.length < 6 && ls > 0) {
             ls--;
         }
         return ls;
     }
     function Evaluate(s) {
         var ls = GetLevel(s);
         Clear();
         if (ls <=1) {
             $("#first").css("background-color", "black");
        }
        if (ls == 2) {
            $("#second").css("background-color", "#FFCC33"); 
        }
        if (ls >= 3) {
            $("#third").css("background-color", "#008000"); 
        }
    }
    function Clear() {
        $(".pwdstrong").css("background-color", "#e0e0e0");
    }
    $(document).ready(function () {
        $("#<%=txtNewPassword.ClientID%>").keyup(function () {
            Evaluate($("#<%=txtNewPassword.ClientID%>").val());
           
        });
    });
    function CheckStatus() {
        var newpwd = $("#<%=txtNewPassword.ClientID%>");
        var repwd = $("#<%=txtReinput.ClientID%>")
        if (!newpwd.val() || newpwd.val() == "") {
            alert("新密码不能为空");
            return false;
        }
        if (!repwd.val() || repwd.val() == "") {
            alert("确认密码不能为空");
            return false;
        }
        return true;
    }
  </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="main">
        <div class="top">
            <span class="left">密码找回</span></div>
        <div class="body">
            <h3>
                找回密码，请填写必要资料用于密码找回！</h3>
            <h4>
                密码提示问题：<asp:Literal ID="ltQuestion" runat="server"></asp:Literal></h4>
            <h1>
                密码提示答案：<asp:TextBox ID="txtAnswer" runat="server"></asp:TextBox></h1>
            <h3>重新设置新密码</h3>

          
             <h1>新的密码：<asp:TextBox TextMode="Password"  ID="txtNewPassword"  runat="server"></asp:TextBox></h1>
            <h2 style="margin: 0px auto 5px;">
                安全强度</h2>
            <div style="margin: 0px auto 5px; width: 380px;">
                <table width="180" cellspacing="0" cellpadding="0" style="height: 4px; margin-left: 2px;"
                    id="passwdBar">
                    <tbody>
                        <tr>
                            <td height="4" id="first" class="pwdstrong" style="width: 60px; background-color: #e0e0e0">
                            </td>
                            <td height="4" id="second" class="pwdstrong" style="width: 60px; background-color: #e0e0e0">
                            </td>
                            <td height="4" id="third" class="pwdstrong" style="width: 60px; background-color: #e0e0e0">
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <h1>确认密码：<asp:TextBox TextMode="Password" ID="txtReinput" runat="server"></asp:TextBox></h1>
            <h2><asp:LinkButton ID="btnSave" runat="server" OnClick="ResetPassword" OnClientClick="return CheckStatus();">
                    <img  src="../../Content/Image/Main/prbg-04.jpg"></asp:LinkButton></h2>
        </div>
    </div>
</asp:Content>
